<template>
  <div class="ueditor-wrap">
    <vue-ueditor-wrap v-model="msg" :config="myConfig"></vue-ueditor-wrap>
    <p>
      <el-button type="primary" @click="showOne();">获取编辑器内容</el-button>
    </p>
  </div>
</template>

<script>
import VueUeditorWrap from "vue-ueditor-wrap";
export default {
  name: 'Ueditor',
  components: {
    VueUeditorWrap
  },
  data() {
    return {
      msg:
        '<h2><img src="http://img.baidu.com/hi/jx2/j_0003.gif"/>Vue + UEditor + v-model双向绑定!+!$#</h2>',
      myConfig: {
        UEDITOR_HOME_URL: "/UEditor/",
        // 初始容器高度
        initialFrameHeight: 240,
        // 初始容器宽度
        initialFrameWidth: '100%',
        // 上传文件接口（这个地址是我为了方便各位体验文件上传功能搭建的临时接口，请勿在生产环境使用！！！）
        serverUrl: 'http://35.201.165.105:8000/controller.php',
      }
    };
  },
  methods: {
    showOne() {
      alert(this.msg);
    }
  }
}
</script>
<style lang="scss" scoped></style>
